//
//  limb.h
//  bird
//
//  Created by Xiaochen Lian on 5/6/12.
//  Copyright (c) 2012 University of California, Los Angeles. All rights reserved.
//

#ifndef bird_limb_h
#define bird_limb_h

#include "entity.h"
//#include "wingbeat_param.h"
//#include "feather.h"

//----------------------------------------------------------------------------
// ILIMB
class ILimb : public IEntity
{
public:
    ILimb(const vec4 &pos, GLfloat length);
    void set_material(const lighting_struct &material);
    void draw(const mat4 &tfm_parent);
    //virtual void update(const bird_status &status);
    bool is_right();
    
protected:
    GLfloat m_length; // negatigve means left side
    lighting_struct m_material;
};

//----------------------------------------------------------------------------
// CShoulder
class CArm : public ILimb
{
public:
    CArm(const vec4 &pos, GLfloat length);
    void build_model(const point4 &parent_mass_center);
    pair<vec4, vec4> aerodynamics(const bird_status &nstatus, const mat4 &tfm, const double timestep);
    void update(const bird_status &cstatus, const mat4 tfm_parent);
};

////----------------------------------------------------------------------------
//// CForearm
//class CForearm : public ILimb
//{
//public:
//    CForearm(const vec4 &pos, GLfloat length);
//    void build_model();
//    void update(const bird_status &status);
//};

//----------------------------------------------------------------------------
// CWrist
class CWrist : public ILimb
{
public:
    CWrist(const vec4 &pos, GLfloat length);
    void build_model(const point4 &parent_mass_center);
    pair<vec4, vec4> aerodynamics(const bird_status &nstatus, const mat4 &tfm, const double timestep);    
    void update(const bird_status &cstatus, const mat4 tfm_parent);
};

#endif